package com.seednia.module.core.resource.dto;

import org.apache.commons.lang.StringUtils;

import com.seednia.foundation.framework.dto.AbstractRecord;
import com.seednia.foundation.framework.dto.ICriteria;
import com.seednia.module.core.search.util.AbstractQueryBuilder;

public class ResourceQueryBuilder extends AbstractQueryBuilder {

	@Override
	public String buildQueryString(ICriteria record) {
		MediaDto dto = (MediaDto)record;
		StringBuilder retval = new StringBuilder();
		// OR-ed 
		if ( StringUtils.isNotBlank(dto.getCreatorDto().getFirstName()) ) {
			retval.append("firstName:(").append(dto.getCreatorDto().getFirstName()).append(")");
		}
				
		return retval.toString();
	}

}
